jQuery ($) ->
  $.getScript 'http://tjs.sjs.sinajs.cn/open/api/js/wb.js?appkey=4276143701', () ->
    console.log 'success'
    if !window.USER_CONFIG
      WB2.anyWhere (W) ->
        W.widget.connectButton {
          id : 'wb_connect_btn'
          type : '5,2'
          callback : 
            login : (data) ->
              console.log data
              userInfo = 
                name : data.name
                location : data.location
                type : 'sinaWeibo'
                id : data.id
                avatar : data.profile_image_url
                url : data.profile_url
              console.dir userInfo
              # $.ajax 
              #   url : '/login'
              #   type : 'post'
              #   data : userInfo
              #   success : (data) ->
              #     console.log data
              #   error : () ->
              #     console.log 'err'
            logout : () ->
              console.log 'logout'
        }
